package com.sihan.framework.etm.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.framework.model.BaseModel;
import com.framework.mybatis.annotation.AutoGenerator;
import com.framework.mybatis.enums.IdType;

import java.io.Serializable;

import javax.persistence.*;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 角色权限表
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "jdx_role_permission")
public class RolePermission extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 角色权限ID
	 */
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	@AutoGenerator(idType = IdType.UUID32)
	private String id;

	/**
	 * 角色ID
	 */
	private String roleId;

	/**
	 * 权限ID
	 */
	private String permissionId;

	/**
	 * 是否删除
	 */
	@JsonIgnore
	private Boolean isDelete;

	public RolePermission(String roleId, String permissionId, Boolean isDelete) {
		this.roleId = roleId;
		this.permissionId = permissionId;
		this.isDelete = isDelete;
	}
}
